<?php

if($act=="edit")
{
    $sql_select ="select * from tbllocation where iId='$id'";
    $rs         =$dbsql->query($sql_select);
    if($dbsql->num_rows($rs)==0)
    {
        page_transfer("Location id=$id not exists");
    }
    $location   = $dbsql->fetch_array($rs);
    $where      = FJSON::decode($location['cWhere']);
    $when       = FJSON::decode($location['cWhen']);
    $Highlights = FJSON::decode($location['cHighlights']);
    $QuickFacts = FJSON::decode($location['cQuickFacts']);
    $PracticalTips= FJSON::decode($location['cPracticalTips']);
    
    $Visa       = FJSON::decode($location['cVisa']);    
    $TravelTips = FJSON::decode($location['cTravelTips']);
    $FAQs       = FJSON::decode($location['cFAQs']);
    
}else
{
    $location               = array();
    $location['iParentId']  = $id;
    $location['iStatus']    = 1;
    $id                     = 0;
    $where      = FJSON::decode($location['cWhere']);
    $when       = FJSON::decode($location['cWhen']);
    $Highlights = FJSON::decode($location['cHighlights']);
    $QuickFacts = FJSON::decode($location['cQuickFacts']);
    $PracticalTips= FJSON::decode($location['cPracticalTips']);
    
    $Visa       = FJSON::decode($location['cVisa']);    
    $TravelTips = FJSON::decode($location['cTravelTips']);
    $FAQs       = FJSON::decode($location['cFAQs']);
    
    $Visa->title        = "Visa";
    $TravelTips->title  = "Travel Tips";
    $FAQs->title        = "FAQs";
    $PracticalTips->title= "PRACTICAL HINTS";
}
?>